package demo2;

/*
* 接口当中不能有普通的成员方法
* 除非加default修饰 或者被static修饰
 * */
interface IShpae{
    //接口中的成员变量默认是public static final
    int a = 10;
    //接口中的成员方法默认是public abstrct
    public void draw();


//    default public void test(){
//        System.out.println("");
//    }


//    public static void test(){
//        System.out.println();
//    }

}

class Rect implements IShpae {
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}


class Crecle implements IShpae{
    @Override
    public void draw() {
        System.out.println("圆形");
    }
}




public class Test2 {

    public static void drawMap(IShpae iShpae){
        iShpae.draw();
    }
    public static void main(String[] args) {
        drawMap(new Rect());
        drawMap(new Crecle());
    }
}
